home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / nos042_s / enet.h < prev    next >
C/C++ Source or Header  |  1994-09-16  |  1KB  |  54 lines

  1. #ifndef    _ENET_H
  2. #define _ENET_H
  3.  
  4. /* Generic Ethernet constants and templates */
  5.  
  6. #ifndef    _GLOBAL_H
  7. #include "global.h"
  8. #endif
  9.  
  10. #ifndef    _MBUF_H
  11. #include "mbuf.h"
  12. #endif
  13.  
  14. #ifndef    _IFACE_H
  15. #include "iface.h"
  16. #endif
  17.  
  18. #define    EADDR_LEN    6
  19. /* Format of an Ethernet header */
  20. struct ether {
  21.     char dest[EADDR_LEN];
  22.     char source[EADDR_LEN];
  23.     int16 type;
  24. };
  25. #define    ETHERLEN    14
  26.  
  27. /* Ethernet broadcast address */
  28. extern char Ether_bdcst[];
  29.  
  30. /* Ethernet type fields */
  31. #define    IP_TYPE        0x800    /* Type field for IP */
  32. #define    ARP_TYPE    0x806    /* Type field for ARP */
  33. #define    REVARP_TYPE    0x8035    /* Type field for reverse ARP */
  34.  
  35. #define    RUNT        60    /* smallest legal size packet, no fcs */
  36. #define    GIANT        1514    /* largest legal size packet, no fcs */
  37.  
  38. #define    MAXTRIES    16    /* Maximum number of transmission attempts */
  39.  
  40. /* In file enet.c: */
  41. char *pether __ARGS((char *out,char *addr));
  42. int gether __ARGS((char *out,char *cp));
  43. int enet_send __ARGS((struct mbuf *bp,struct iface *iface,int32 gateway,int prec,
  44.     int del,int tput,int rel));
  45. int enet_output __ARGS((struct iface *iface,char dest[],char source[],int16 type,
  46.     struct mbuf *data));
  47. void eproc __ARGS((struct iface *iface,struct mbuf *bp));
  48.  
  49. /* In enethdr.c: */
  50. struct mbuf *htonether __ARGS((struct ether *ether,struct mbuf *data));
  51. int ntohether __ARGS((struct ether *ether,struct mbuf **bpp));
  52.  
  53. #endif    /* _ENET_H */
  54.